import Vue from "vue";

Vue.filter("dateFormat", (val) => {
    const date = new Date(Date.parse(val));
    const Y = date.getFullYear();
    const M = String(date.getMonth() + 1).padStart(2, "0");
    const D = String(date.getDate()).padStart(2, "0");

    const hh = String(date.getHours()).padStart(2, "0");
    const mm = String(date.getMinutes()).padStart(2, "0");
    const ss = String(date.getSeconds()).padStart(2, "0");
    return `${Y}-${M}-${D} ${hh}:${mm}:${ss}`;
});
